import request from '@/utils/request'
import { pageType, TRes2, sysUserType, addType, TRes } from './apiType'

// 员工列表数据
export function sysUser(data: pageType) {
  return request.get<TRes2<sysUserType>>({ url: '/sys/user', params: data })
}

/**
 * 获取用户基本信息
 */
export function getUser(id: string) {
  return request.get<any>({ url: '/sys/user/' + id })
}

/**
 * 获取用户基本信息
 */
export function assignRoles(data: any) {
  return request.put<{ message: string }>({
    url: '/sys/user/assignRoles/',
    data
  })
}

// 新增员工
export function sysUserPost(data: addType) {
  return request.post<TRes<null>>({ url: '/sys/user', data })
}
